<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>首页</title>
    <!-- Path to Framework7 Library CSS-->
    <link rel="stylesheet" href="css/framework7.ios.min.css">
    <link rel="stylesheet" href="css/framework7.ios.colors.min.css">
    <!-- Path to your custom app styles-->
    <link rel="stylesheet" href="css/my-app.css">
    <link rel="stylesheet" href="css/myPageCss/mypageCenter.css"/>
    <!--医生列表-->
    <link rel="stylesheet" href="css/index/index-2.css"/>
    <link rel="stylesheet" href="http://www.swiper.com.cn/dist/css/swiper.min.css"/>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.1/js/swiper.min.js"></script>
    <style type="text/css">
        body {
            background-color: white;
        }
        body:before {
    content: "";
    font-size: 150%;
    line-height: 2;
    text-align: center;
    color: #fff;
    background: #3566f2;
    display: block;
}

        .icon-right {
            position: absolute;
            background: url(img/Right-Chevron.png) no-repeat right center transparent;
            background-size: 25px 25px;
            top: 7px;
            left: 7px;
            text-align: left;
            color: #fff;
            font-size: 18px;
        }
        .icon-top {
            top: 7px;
            border: none;
        }
        .top-item-text {
            margin: -5px auto;
            font-size: 13px;
            color: white;
        }

        .content-img {
            width: 13vw;
            height: 13vw;
            margin: 5px auto;
        }

        .content-text {
            margin: -5px auto;
            font-size: 4vw;
            color: #333333;
        }

        .item-width-25 {
            width: 25%;
            height: 25%;
        }

        .item-width-50 {
            width: 50%;
        }
        .table{float:left; position:relative; width:100%;overflow: hidden}
        .table .auto_content_wrap_table{position:relative; overflow:hidden; width:100%; height:71px}
        .table .auto_con_table{position:absolute; left:0; top:0; opacity:0; filter:alpha(opacity=0)}
        .table img{display:block; width:100%; height:80px;
            float: left;}
        .table .curr_con_table{opacity:1; filter:alpha(opacity=100); z-index:5}
        .table .auto_tab_table{position:absolute; left:0; bottom:0; z-index:6; width:100%; text-align:center}
        /*.table .auto_tab_table span{display:inline-block; cursor:pointer; background:url(img/ico_autoTab.png) no-repeat; _background:url(img/ico_autoTab2.png) no-repeat; width:10px; height:10px; margin:0 5px; overflow:hidden}*/
        /*.table .auto_tab_table .curr_table{background-position:0 -10px}*/
        .section-btn {
            width: 67px;
            border: none;
            font-size: 13px;
            color: #333333;
        }
        .left-box {
            left: 15px;
        }
        .index_box2{
            width: 100%;
            height: 40vw;
            overflow: hidden;
            box-sizing:border-box;
            -moz-box-sizing:border-box;
            -webik-box-sizing:border-box;
        }
        .index_box2 .left{
            width: 40%;
            float: left;
            height: 100%;
            overflow: hidden;
            border-right:1px solid #e1e1e1;
            box-sizing:border-box;
            -moz-box-sizing:border-box;
            -webik-box-sizing:border-box;
        }
        .index_box2 .left img{
            width: 16vw;
            height: 16vw;
            display: block;
            margin: 3vw auto;
        }
        .index_box2 .left .p1{
            font-size: 4.3vw;
            color: #333;
            text-align: center;
            margin: 0;
        }
        .index_box2 .left .p2{
            font-size: 3.8vw;
            color: #999;
            text-align: center;
            margin: 3vw 0;
        }
        .index_box2 .right{
            float: left;
            width: 60%;
            overflow: hidden;
        }
        .index_box2 .right .public{
            width: 100%;
            height:20vw;
            border-bottom: 1px solid #e1e1e1;
            overflow: hidden;
        }
        .index_box2 .right .public .l{
            width:60%;
            float: left;
            overflow: hidden;
        }
        .index_box2 .right .public .l .p1{
            font-size: 4.3vw;
            color: #333;
            margin: 3vw 4vw;
        }
        .index_box2 .right .public .l .p2{
            font-size: 3.4vw;
            color: #999;
            margin: 3vw 4vw;
        }
        .index_box2 .right .public img{
            float: left;
            width: 35%;
            height: 18vw;
            margin: 1vw 0;
            overflow: hidden;
            background: red;
        }


        /*搜索框*/
        .searchbox{
            width: 100%;
            height: 44px;
            overflow: hidden;
            background: rgba(0,0,0,.4);

            position: fixed;
            top:0;
            z-index: 99999;
        }
        .searchbox.hover{
            -webkit-animation: searchbox 0.5s linear 0s forwards;
        }
        @-webkit-keyframes searchbox {
            0%{
                opacity: 0.6;
                background: rgba(255,255,255,.2);
            }

            100%{
                opacity: 1;
                background: rgba(0,0,0,.4);
            }
        }

        .searchbox.hover2{
            -webkit-animation: searchbox2 0.5s linear 0s forwards;
        }
        @-webkit-keyframes searchbox2 {
            0%{
                opacity: 1;
                background: rgba(0,0,0,.4);
            }

            100%{
                opacity: 0.6;
                background: rgba(255,255,255,.4);
            }
        }
        .searchbox .left{
            width: 70%;
            height: 1.7rem;
            background: #f1eeee;
            border-radius: 5px;
            float: left;
            margin-left: 5%;
            margin-top: 8px;
        }
        .searchbox .left img{
            float: left;
            width: 5.5%;
            margin: 0.32rem 0.4rem;
        }
        .searchbox .left input{
            width: 80%;
            float: left;
            height: auto;
            margin-top: 0.12rem;
            background: none;
            font-size: 0.9rem;
            border: none;
        }
        .searchbox button{
            float: left;
            width: 18%;
            border-radius: 5px;
            height: 1.7rem;
            background: #00b57d;
            color: #fff;
            font-size: 0.9rem;
            border: none;
            margin-left: 2%;
            font-family: '微软雅黑';
        }
        .searchbox p{
            margin: 0.8rem 0.5rem 0 1.5rem;
            color: #fff;
        }
    </style>
</head>
<body>
<div class="searchbox">
    <p style="float:left;">北京</p>
    <div class="left">
        <img src="shoppingMall/images/icon2.png">
        <input type="text" placeholder="输入疾病、医生、医院、科室">
    </div>
</div>
<div class="views tabs toolbar-through">
    <!--导航条-->

    <div id="view-1" class="view view-main tab active">
        <!-- Pages容器-->
        <div class="pages" style=" background: none;">

            <!-- Page, data-page contains page name-->
            <div data-page="index-1" class="page">
                <!-- Scrollable page content-->
                <div class="page-content" style="background-color: white;">
                    <!--轮播图-->
                    <div style="margin-top: 44px;" class="swiper-container swiper-container-horizontal">
                        <div class="swiper-wrapper">

                        </div>
                        <div class="swiper-pagination swiper-pagination-clickable swiper-pagination-bullets"></div>
                    </div>
                    <!--8个icon-->
                    <table id="index_topicon" style="width: 100%;text-align: center;border-collapse: collapse;">
                        <tr id="top-centent">
                        </tr>
                        <tr id="bottom-centent">
                        </tr>
                    </table>
                    <div style=" width: 100%; height: 13px; background: #ebebeb"></div>
                    <div class="index_box2">

                    </div>
                    <div style=" width: 100%; height: 13px; background: #ebebeb"></div>
                    <!--常见科室-->
                    <div style="position: relative;width: 100%;height: 111px;top: 0px;border-top: 1px solid #e6e6e6;border-bottom: 1px solid #e6e6e6">
                        <span style="position: absolute;line-height: 30px;font-size: 11px;color: #333333;left: 15px;height: 30px;">常见科室</span>
                        <div class="content-block" id="bg_list" style="position: absolute;width: 100%;height: 71px">
                            <div class="row" id="hot_department_top">
                                <div class="col-25 button section-btn" id="backgroudColor1"></div>
                                <div class="col-25 button section-btn" id="backgroudColor2"></div>
                                <div class="col-25 button section-btn" id="backgroudColor3"></div>
                                <div class="col-25 button section-btn" id="backgroudColor4"></div>
                            </div>
                            <div class="row" id="hot_department_bottom" style="margin-top: 7px">
                                <div class="col-25 button section-btn" id="backgroudColor5"></div>
                                <div class="col-25 button section-btn" id="backgroudColor6"></div>
                                <div class="col-25 button section-btn" id="backgroudColor7"></div>
                                <div class="col-25 button section-btn" id="backgroudColor8"></div>
                            </div>
                        </div>
                    </div>
                    <div style=" width: 100%; height: 13px; background: #ebebeb"></div>
                    <!--热门医院-->
                    <div style="position: relative;width:100%;top:0px;border-top: 1px solid #e6e6e6">
                        <span style="position: absolute;line-height: 30px;font-size: 11px;color: #333333;left: 15px;height: 21px;">热门医院</span>

                        <div id="hostpital" style="margin-top: 21px;">
                        </div>

                        <div id="all_hospital" style="position: relative;margin-top: 0;width: 100%;height: 43px;color: #999999;font-size: 12px;text-align: center;line-height: 43px;border-bottom: 1px solid #e6e6e6">查看全部</div>
                        <!--<div style="position: relative;height: 100px;width: 60%"></div>-->
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- Second view (for second wrap)-->
    <div id="view-2" class="view tab">
                <!-- We can make with view with navigation, let's add Top Navbar-->
        <div class="navbar">
            <div class="navbar-inner" style="background-color: #38a16d">
                <div class="center sliding" style="color: white">口碑医生</div>
            </div>
            <!--选择-->
            <div class="tabs-choose text-center" style="margin-top: 44px">
                <div id="dropdownHospital" class="icon-right2" style="border-right: 1px solid #EDEDED">全部医院</div>
                <div id="dropdownDepartment_department" class="icon-right2" style="border-right: 1px solid #EDEDED">全部科室</div>
                <div id="dropdownDepartment" class="icon-right2">综合排序</div>
            </div>
        </div>
    <div class="pages navbar-through">
        <div data-page="index-2" class="page page-on-center">
            <div class="page-content pull-to-refresh-content infinite-scroll">
                <!-- 默认的下拉刷新层 -->
                <div class="pull-to-refresh-layer">
                    <div class="preloader"></div>
                    <div class="pull-to-refresh-arrow"></div>
                </div>

                <div class="main-content">
                    <!--选择-->
                    <div class="sel-popup" style="display:none;">
                        <div id="hospitalItems" class="item-content" style="display:none;height: 280px">
                            <div class="list item-left text-center" id="hospitalList"></div>
                        </div>

                        <div id="departmentItems" class="item-content" style="display:none;">
                            <div class="text-center item-left list" id="departmentLeft">
                                <a data-name="全部职称" data-id="" class="list-item text-left list-item-p-tb15 list-item-norightborder">全部职称</a>
                                <a data-name="主任医师" data-id="43" class="list-item text-left list-item-p-tb15 list-item-norightborder">主任医师</a>
                                <a data-name="副主任医师" data-id="42" class="list-item text-left list-item-p-tb15 list-item-norightborder">副主任医师</a>
                                <a data-name="主治医师" data-id="41" class="list-item text-left list-item-p-tb15 list-item-norightborder">主治医师</a>
                                <a data-name="教授" data-id="68" class="list-item text-left list-item-p-tb15 list-item-norightborder">教授</a>
                                <a data-name="副教授" data-id="69" class="list-item text-left list-item-p-tb15 list-item-norightborder">副教授</a>
                            </div>
                        </div>

                        <div id="departmentItems_department" class="item-content" style="display:none;">
                            <div class="text-center item-left list" id="departmentLeft_department"></div>
                            <div class="text-center item-right list" id="departmentRight_department"></div>
                        </div>
                        <div class="over-popup"></div>
                    </div>
                    <!--医生列表-->
                    <div id="doctorItems"></div>

                    <!--搜索无结果-->
                    <div id="searchIcon" style="position: absolute;display: none; margin-top: 173px;width: 100%;text-align: center">
                        <img src="img/icon-girl.png" alt="小女孩" style="width: 125px;height: 61px;left: 50%"/>
                        <p style="font-size: 13px;color: #808080">没有符合条件的医生</p>
                    </div>

                    <!-- 加载提示符 -->
                    <div class="infinite-scroll-preloader">
                        <div class="preloader"></div>
                    </div>

                </div>
            </div>
        </div>
    </div>
    </div>
    <div id="view-3" class="view tab">
            <div class="pages">
            <div data-page="index-3" class="page">
            <div class="page-content">
            <div class="content-block-title">Another plain static view</div>
    <div class="content-block">
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vel commodo massa, eu adipiscing mi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus ultricies dictum neque, non varius tortor fermentum at. Curabitur auctor cursus imperdiet. Nam molestie nisi nec est lacinia volutpat in a purus. Maecenas consectetur condimentum viverra. Donec ultricies nec sem vel condimentum. Phasellus eu tincidunt enim, sit amet convallis orci. Vestibulum quis fringilla dolor.    </p>
    <p>Mauris commodo lacus at nisl lacinia, nec facilisis erat rhoncus. Sed eget pharetra nunc. Aenean vitae vehicula massa, sed sagittis ante. Quisque luctus nec velit dictum convallis. Nulla facilisi. Ut sed erat nisi. Donec non dolor massa. Mauris malesuada dolor velit, in suscipit leo consectetur vitae. Duis tempus ligula non eros pretium condimentum. Cras sed dolor odio.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vel commodo massa, eu adipiscing mi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus ultricies dictum neque, non varius tortor fermentum at. Curabitur auctor cursus imperdiet. Nam molestie nisi nec est lacinia volutpat in a purus. Maecenas consectetur condimentum viverra. Donec ultricies nec sem vel condimentum. Phasellus eu tincidunt enim, sit amet convallis orci. Vestibulum quis fringilla dolor.    </p>
    </div>
    </div>
    </div>
    </div>
    </div>
    <div id="view-4" class="view tab">
        <div class="pages ">
            <div data-page="index-4" class="page">
                <div class="page-content">
                     <div style="position:absolute;width: 100%;height: 164px;background-color: #43af80">
                        <img src="img/ico_ures_sj.png" alt="头像" class="user-img" id="userimg"/>
                        <p class="user-name" id="username">名称</p>
                        <img src="img/mypage_img/iconfont-shezhi.png" alt="设置" class="user-setup"/>
                        <div style="position:absolute;width: 100%;height: 38px;background-color: #3ea779;bottom: 0;">
                        <div class="row no-gutter">
                        <div id="actievement" class="col-50 user-detailInformation user-achievement" style="border-right: 1px solid #8bcaaf;">成就：0</div>
                        <div id="income" class="col-50 user-detailInformation user-income" style="">收入：0</div>
                        </div>
                        </div>
                     </div>
                    <div class="list-block" style="margin-top: 164px">
                        <ul>
                            <li id="user_center" style="background: url(img/icon_right.png) no-repeat 98% center, url(img/mypage_img/iconfont-icon.png) no-repeat 10px center transparent;background-size: 22px 22px;">个人中心</li>
                            <li id="user_family" style="background: url(img/icon_right.png) no-repeat 98% center, url(img/mypage_img/iconfont-qunzu.png) no-repeat 10px center transparent;background-size: 22px 22px;">家庭联系人</li>
                            <li id="user_orders" style="background: url(img/icon_right.png) no-repeat 98% center, url(img/mypage_img/iconfont-dingdan.png) no-repeat 10px center transparent;background-size: 22px 22px;">我的订单</li>
                            <li id="user_disMoney" style="background: url(img/icon_right.png) no-repeat 98% center, url(img/mypage_img/iconfont-money.png) no-repeat 10px center transparent;background-size: 22px 22px;">诊疗金</li>
                            <li id="user_message" style="background: url(img/icon_right.png) no-repeat 98% center, url(img/mypage_img/iconfont-xiaoxi.png) no-repeat 10px center transparent;background-size: 22px 22px;">系统消息</li>
                            <!--<li id="user_good" style="background: url(img/icon_right.png) no-repeat 98% center, url(img/mypage_img/iconfont-pingjiaguanli.png) no-repeat 10px center transparent;background-size: 22px 22px;">好评赚诊疗金</li>-->
                            <!--<li id="user_share" style="background: url(img/icon_right.png) no-repeat 98% center, url(img/mypage_img/iconfont-fenxiang.png) no-repeat 10px center transparent;background-size: 22px 22px;">分享</li>-->
                        </ul>
                    </div>

                </div>
            </div>
        </div>
    </div>

                <!-- Bottom Tabbar-->
    <div class="toolbar tabbar tabbar-labels">
            <div class="toolbar-inner">
            <a href="#view-1" class="tab-link active">
            <img src="img/icon_both_0.png" alt="首页" class="icon" style="height: 25px;width: 25px;"/>
            <span class="tabbar-label">首页</span>
            </a>
            <a href="#view-2" class="tab-link">
            <!--<i class="icon tabbar-demo-icon-2"></i>-->
            <img src="img/icon_both_1.png" alt="口碑医生" class="icon" style="height: 25px;width: 25px;"/>
            <span class="tabbar-label">口碑医生</span>
            </a>
            <a href="http://www.ekangjiuyi.com/wechat/activity/demo/" class="tab-link">
                <!--<i class="icon tabbar-demo-icon-3">-->
            <!--<span class="badge bg-red">4</span>-->
            <!--</i>-->
            <img src="img/icon_both_2.png" alt="易赚钱" class="icon" style="height: 25px;width: 25px;"/>
            <span class="tabbar-label">易赚钱</span>
            </a>
            <a href="#view-4" class="tab-link" id="click_mypage">
                <!--<i class="icon tabbar-demo-icon-4"></i>-->
                <img src="img/icon_both_3.png" alt="我的" class="icon" style="height: 25px;width: 25px;"/>
                <span class="tabbar-label">我的</span>
            </a>
            </div>
            </div>
</div>
<script type="text/javascript" src="js/framework7.min.js"></script>
<script type="text/javascript" src="js/my-app.js"></script>
<script src="js/jquery-1.10.2.js"></script>
<script src="js/ekang.js"></script>
<script src="js/jquery.cookie.js"></script>
<!--<script src="js/sousou.js"></script>-->
<script>

    var longitude;      //经度
    var latitude;       //纬度
    //=========== 首页  ===========
    $(function(){
//        alert($.cookie("local_userId"));
//点击进入搜索
        numberuid = /^[0-9]+.?[0-9]*$/;

        $('.searchbox input').on('touchstart',function(){
           location.href = 'searchPage.html'
        });
        sousou_key =  getQueryString('enkey');
        var ua = navigator.userAgent.toLowerCase();
        if(ua.match(/MicroMessenger/i)=="micromessenger") {
            is_wechat = 0;
            $.cookie('is_wechat', is_wechat, { expires: 7,path: '/' });
        } else {
            is_wechat = 1;
            $.cookie('is_wechat', is_wechat, { expires: 7,path: '/' });
        }
//        enkey(sousou_key)
        /// 地理定位
        function getLocation()
        {
            if (navigator.geolocation)
            {
                navigator.geolocation.getCurrentPosition(showPosition,showError);
            }else{
                alert("现不支持定位");
//                app.getDepartment_index1();
            }
        }
        function showPosition(position)
        {
            longitude = position.coords.longitude;
            latitude = position.coords.latitude;
            $.cookie('longitude', longitude, { expires: 7,path: '/' });
            $.cookie('latitude', latitude, { expires: 7,path: '/' });
//            app.getDepartment_index1();
        }
        function showError(error){
            switch(error.code)
            {
                case error.PERMISSION_DENIED:
                    console.log("请在设置中打开定位功能");
                    break;
                case error.POSITION_UNAVAILABLE:
//                    alert("无法获取当前位置");
                    break;
                case error.TIMEOUT:
                    alert("操作超时");
                    break;
                case error.UNKNOWN_ERROR:
                    alert("An unknown error occurred.");
                    break;
            }
//            app.getDepartment_index1();
        }
//            开始定位
        getLocation();

        $('#searchGo').on('click', function () {
            location.href = "searchPage.html";
        });



        $.ajax({
            type: 'GET',
            url: textUrl+'index.php/wish/index/show',
            data: {
                longitude: $.cookie("longitude"),
                latitude: $.cookie("latitude"),
                enkey : sousou_key
            },
            dataType: 'jsonp',
            jsonp: 'callback',
            success: function (res) {
                if(res.ret==0){
                    var data = res.data;
                    if(data.uid>0){
                        $.cookie('local_userId', result.data.uid, { expires: 7,path: '/' });
                    }
                    // 轮播图
                    var focus_pic = data.focus_pic;
                    for(var c=0;c<focus_pic.length;c++){
                        var focus_pic_list = focus_pic[c];
                        var foucs_items_1 = '';
                        foucs_items_1 += '<div class="swiper-slide swiper-slide-active" style="width:100%; height:46vw;"><img data-url="'+focus_pic_list.h5_web_url+'" data-id="0" src="'+focus_pic_list.pic_url+'" alt="banner" style="width: 100%;height:46vw;" class=""></div>';
                        $('.swiper-wrapper').append(foucs_items_1);
                        $('.swiper-wrapper img').click(function(){
                           var url = $(this).data('url');
                            if(numberuid.test($.cookie("local_userId"))){
                                location.href = url;
                            }else{
                                location.href = "login.html";
                            }
                        });
                    }
                    var swiper = new Swiper('.swiper-container', {
                        pagination: '.swiper-pagination',
                        paginationClickable: true
                    });
                    //8个按钮
                    var  centent = data.top;
                    for(var cent=0;cent<centent.length;cent++){
                        if(cent<4){
                            var cententList_top = centent[cent];
                            var centent_items_top = '';
                            centent_items_top += '<td data-url="'+cententList_top.h5_web_url+'" data-id="'+cententList_top.type+'" class="item-width-25 right-border bottom-border" >';
                            centent_items_top += '<img src="'+cententList_top.pic_url+'" alt="找医院" class="content-img"/>';
                            centent_items_top += '<p class="content-text">'+cententList_top.pic_text+'</p>';
                            centent_items_top += '<br/>';
                            centent_items_top += '</td>';
                            $('#top-centent').append(centent_items_top);
                        }
                        if(cent>=4){
                            var cententList_bottom = centent[cent];
                            var centent_items_bottom = '';
                            centent_items_bottom += '<td data-url="'+cententList_bottom.h5_web_url+'" data-id="'+cententList_bottom.type+'" class="item-width-25 right-border bottom-border" >';
                            centent_items_bottom += '<img src="'+cententList_bottom.pic_url+'" alt="找医院" class="content-img"/>';
                            centent_items_bottom += '<p class="content-text">'+cententList_bottom.pic_text+'</p>';
                            centent_items_bottom += '<br/>';
                            centent_items_bottom += '</td>';
                            $('#bottom-centent').append(centent_items_bottom);
                            weburl = cententList_bottom.web_url
                        }
                    }
//                    $('#index_topicon td').eq(0).click(function(){
//                        location.href = 'http://www.ekangjiuyi.net/EKang2.0/hospitalInformation/hospital_type.html';
//                    });
//
//                    $('#index_topicon td').eq(1).click(function(){
//                        location.href = 'http://www.ekangjiuyi.net/EKang2.0/memberCenter/index.html';
//                    });
//                    $('#index_topicon td').eq(2).click(function(){
//                        if(numberuid.test($.cookie("local_userId"))){
//                            location.href = "http://www.ekangjiuyi.net/EKang2.0/shoppingMall/index.html";
//                        }else{
//                            location.href = "login.html";
//                        }
//                    });
//                    $('#click_mypage').click(function () {
//
//                        if(!numberuid.test($.cookie("local_userId"))){
//                            location.href = "login.html";
//                        }
//                    });
//                    $('#index_topicon td').eq(3).click(function(){
//                        location.href = "http://www.ekangjiuyi.net/EKang2.0/examination/examination.html";
//                    });
//                    $('#index_topicon td').eq(4).click(function(){
//                        location.href = "http://www.ekangjiuyi.net/EKang2.0/chineseMedicine/index.html";
//                    });
//                    $('#index_topicon td').eq(5).click(function(){
//                        location.href = "http://www.ekangjiuyi.net/EKang2.0/bed_surgery/bed_surgery.html";
//                    });
//                    $('#index_topicon td').eq(6).click(function(){
//                        if(numberuid.test($.cookie("local_userId"))){
//                            location.href = "http://www.ekangjiuyi.net/EKang2.0/geneticTesting/index.html";
//                        }else{
//                            location.href = "login.html";
//                        }
//                    });
                    $('#index_topicon td').click(function(){
                        var url = $(this).attr('data-url');
                        if(numberuid.test($.cookie("local_userId"))){
                            location.href = url
                        }else{
                            location.href = "login.html";
                        }
                    });


                    //仨板块
                    var sjcenter = data.center;
                    $('.index_box2').append('<div class="left"><img src="'+sjcenter[0].pic_url+'"><p class="p1">'+sjcenter[0].pic_text+'</p><p class="p2">'+sjcenter[0].pic_desc_text+'</p></div><div class="right"><div class="consultingDoctor public"><div class="l"><p class="p1">'+sjcenter[1].pic_text+'</p><p class="p2">特邀专家为您解答</p></div><img src="'+sjcenter[1].pic_url+'"></div><div class="groupconsultation public"><div class="l"><p class="p1">'+sjcenter[2].pic_text+'</p><p class="p2">特邀专家为您解答</p></div><img src="'+sjcenter[2].pic_url+'"></div></div>');

                    $('.index_box2 .left').click(function(){
                        location.href = 'http://www.ekangjiuyi.net/EKang2.0/hospitalInformation/hospital_type.html';
                    });
                    $('.index_box2 .right .consultingDoctor').click(function(){
                        if(numberuid.test($.cookie("local_userId"))){
                            location.href = "./consultationdetails/expertconsultation.html";
                        }else{
                            location.href = "login.html";
                        }
                    });
                    $('.index_box2 .right .groupconsultation').click(function(){
                        location.href = "groupconsultation/groupconsultationh5.html?uid="+$.cookie("local_userId");
                    });
                    // 常见科室
                    var hot_department = data.hot_department;
                    var color = ["#fffbed","#fcf1fe","#ffedf1","#e5fcff","#f0fcff","#edfdf3","#fff7e4","#fde7fa"];
                    for(var i=0;i<color.length;i++){
                        $('#bg_list .button').eq(i).css('background',color[i]);
                        $('#bg_list .button').eq(i).html(hot_department[i].department_name);
                        $('#bg_list .button').eq(i).attr('data-index',i);
                    }
                    $('#bg_list .button').click(function(){
                        var index = $(this).data('index');
                        $.cookie('departmentname', hot_department[index].department_name, { expires: 7,path: '/' });
                        location.href = "chooseDoctor/doctorList.html?departmentid="+hot_department[index].department_id;
                    });
                    $('#backgroudColor8').click(function () {
                        location.href = 'chooseDoctor/forDoctors.html'
                    });


                    // 热门医院
                    var hot_hospital_arr = data.hot_hospital;
                    for(var j=0;j<hot_hospital_arr.length;j++){
                        var hospitalList = hot_hospital_arr[j];
                        var hospitalItems = '';
                        hospitalItems += '<div data-id="'+ hospitalList.id+'" onclick="hospitalDetail($(this))" style="position:relative;width: 100%;height: 61px;border-bottom: 1px solid #e6e6e6">';
                        hospitalItems += '<img src="'+hospitalList.pic+'" alt="头像" class="left-box" style="position: absolute;width: 40px;height: 40px;border-radius: 4px;top:10px"/>';
                        hospitalItems += '<div style="position: absolute;font-size: 14px;color: #333333;top: 11px;left: 56px; width: 80%" class="message">'+hospitalList.hospital_name+'&nbsp&nbsp<span style="position: absolute;width: 33px;height: 16px;line-height:16px;font-size: 12px;background-color: #f95e64;color: white;text-align: center;border-radius: 2px">'+hospitalList.type_text+'</span></div>';
                        hospitalItems += '<span style="position: absolute;font-size: 12px;color: #808080;top: 31px;left: 56px" class="message">'+hospitalList.direction+'</span>';
                        hospitalItems += '<span class="message" style="position: absolute;text-align: right;font-size: 12px;color: #808080;right: 15px;top: 30px;background: url(img/icon_position.png) no-repeat right center transparent; background-size: 9px 13px;background-position: 0 0;">&nbsp&nbsp&nbsp&nbsp&nbsp'+hospitalList.distance+'</span>';
                        hospitalItems += '</div>';

                        $('#hostpital').append(hospitalItems);
                    }

                    console.log(data)
                }else{
                    console.log(res.msg)
                }
            }
        });

        var app = {
            //获取资产信息
            getDepartment_index1: function () {
                    $.ajax({
                        type: 'GET',
                        url: textUrl+'index.php/wish/index',
                        data: {
                            longitude: $.cookie("longitude"),
                            latitude: $.cookie("latitude"),
                            enkey : sousou_key
//                        longitude: "1000",
//                        latitude: "1000"
                        },
                        dataType: 'jsonp',
                        jsonp: 'callback',
                        success: function (result) {
                            if (result.ret == 0) {
                                // 顶部四个按钮
//                                var web_url = result.data.focus_pic_1[0].web_url
//                                var web_url2 = result.data.center[7].web_url
//
//                                $('#top_list_content img').on('click', function () {
//                                    var currentIndex = $(this).data('index');
//                                    if(currentIndex == 0){
//                                        location.href = "http://ekang.ren/wechat/activity/index/"
//                                    }else if(currentIndex == 1){
//                                        location.href = "chooseDoctor/doctorList.html";
//                                    }else if(currentIndex == 2){
////                                    location.href = "myCenter/diagnosis_money.html";
//                                        location.href = "groupconsultation/groupconsultationh5.html?uid="+$.cookie("local_userId");
//                                    }else if(currentIndex == 3){
//                                        location.href = "near_hospital/near_hospital.html";
//                                    }
//                                });







                                $.ajax({
                                    type : 'get',
                                    url : textUrl+'index.php/wish/index',
                                    dataType : 'jsonp',
                                    data : {
                                        longitude: $.cookie("longitude"),
                                        latitude: $.cookie("latitude")
                                    },
                                    success : function(res) {
                                        console.log(res);
                                        if(res.ret==0){
                                            ban_url = res.data.focus_pic_2[0].web_url
                                            $('#bannerImage img').click(function(){
                                                //alert($(this).attr(('data_id')))
                                                var data_id = $(this).attr('data-id');
                                                location.href = res.data.focus_pic_2[data_id].web_url
                                            })
                                        }else{
                                            console.log(res.msg)
                                        }

                                    }
                                });

                            }
                        }
                    });
            }
        };
//        app.getDepartment_index1();

        $('#callPhone').click(function () {
            location.href = "tel://4006305060";
        })

        $('#all_hospital').click(function () {
            location.href = "hospitalInformation/hospital_type.html";
        });

        // 列表---轮播图
        function autoPlayImg_table(autoWrap){
            var $playCon=autoWrap.children(".auto_con_table");
            var $playIco=autoWrap.siblings(".auto_tab_table").find("span");
            var $playInfo=autoWrap.siblings(".auto_info_table").find("li");
//            $playIco.eq(0).addClass("curr_table");
            $playCon.eq(0).addClass('curr_con_table');
            $playInfo.eq(0).show();
            var i=0;
            var iNow=0;
            for(i=0; i<$playIco.length; i++){
                $playIco[i].index=i;
                $playIco[i].onclick=function(){
                    clearInterval(timer);
                    if(iNow==this.index){
                        return;
                    }
                    iNow=this.index;
                    tab_play();
                    timer=setInterval(turnNext,3000);
                }
            }
            function tab_play(){
                for(i=0; i<$playIco.length; i++){
//                    $playIco.removeClass("curr_table");
                    $playCon.stop().animate({opacity:0},600).removeClass('curr_con_table');
                    $playInfo.hide();
                }
                $playIco.eq(iNow).addClass("curr");
                $playCon.eq(iNow).stop().animate({opacity:1},600).addClass('curr_con_table');
                $playInfo.eq(iNow).show();
            }
            function turnNext(){
                iNow++;
                if(iNow>=$playIco.length){
                    iNow=0;
                }
                tab_play();
            }
            var timer=setInterval(turnNext,3000);
        }
//          自动播放
        var $autoWrap_tab=$(".auto_content_wrap_table");
        autoPlayImg_table($autoWrap_tab);
        //轮播图
        function autoPlayImg(autoWrap){
            var $playCon=autoWrap.children(".auto_con");
            var $playIco=autoWrap.siblings(".auto_tab").find("span");
            var $playInfo=autoWrap.siblings(".auto_info").find("li");
            $playIco.eq(0).addClass("curr");
            $playCon.eq(0).addClass('curr_con');
            $playInfo.eq(0).show();
            var i=0;
            var iNow=0;
            for(i=0; i<$playIco.length; i++){
                $playIco[i].index=i;
                $playIco[i].onclick=function(){
                    clearInterval(timer);
                    if(iNow==this.index){
                        return;
                    }
                    iNow=this.index;
                    tab_play();
                    timer=setInterval(turnNext,3000);
                }
            }
            function tab_play(){
                for(i=0; i<$playIco.length; i++){
                    $playIco.removeClass("curr");
                    $playCon.stop().animate({opacity:0},600).removeClass('curr_con');
                    $playInfo.hide();
                }
                $playIco.eq(iNow).addClass("curr");
                $playCon.eq(iNow).stop().animate({opacity:1},600).addClass('curr_con');
                $playInfo.eq(iNow).show();
            }
            function turnNext(){
                iNow++;
                if(iNow>=$playIco.length){
                    iNow=0;
                }
                tab_play();
            }
            var timer=setInterval(turnNext,3000);
        }
        //自动播放
        var $autoWrap=$(".auto_content_wrap");
        autoPlayImg($autoWrap);
    });

    function hospitalDetail(o){
        var id = o.data("id");

        location.href = "hospitalInformation/hospitalDetail.html?type=1&hospitalId="+id;
    }


    //=========== 口碑医生  =============
    $(function () {
        var     $hospitalItems = $('#hospitalItems'),
                $departmentItems = $('#departmentItems'),
                $departmentItems_department = $('#departmentItems_department');
                childNodes = [], //地区
                departmentNodes = [],  // 科室

                pageIndex = 1;// 页码

                city_code = '';     // 城市id
                hospital_ID = '';   // 医院id
                department_id = ''; // 科室id

        var option = {
            // 获取医院列表
            getHospital: function(){
                $.ajax({
                    type: 'GET',
                    url: textUrl +'/hospital/hospitalList',
                    data: {
                        page_size: '500',
                        page_index: 1,
                        sid: '',
                    },
                    dataType: 'jsonp',
                    jsonp: 'callback',
                    success: function (result) {
                        if (result.ret == 0) {
                            var item = '';
                            $.each(result.data, function (i, o) {
                                item += '<a class="list-item " data-id="' + o.id + '" data-name="'+ o.name+'" style="text-align: left">' + o.name + '</a>';
                            });
                            $('#hospitalList').html(item);

                            $hospitalItems.find('a').on('click', function () {
                                hospital_ID = $(this).data('id');
                                hospital_name = $(this).data('name');
                                $('#dropdownHospital').html(hospital_name);
                                $('#dropdownHospital').click();
                                option.getDoctorList();
                            });
                        }
                    }
                });
            },

            // 获取科室
            getDepartmentList:function () {
                $.ajax({
                    type: 'GET',
                    url: textUrl+'/hospital/department',
                    data: {
                        hospital_id: hospital_ID,
                        page_size: '500',
                        page_index: 1,
                        sid: '',
                    },
                    dataType: 'jsonp',
                    jsonp: 'callback',
                    success: function (result) {
                        $('#departmentRight_department').html('');
                        if (result.ret == 0) {
                            var itemLeft = '';
                            departmentNodes = [];

                            $.each(result.data, function (i, o) {
                                var data = o;

                                departmentNodes.push(o.child_department);

                                itemLeft += '<a class="list-item text-left list-item-p-tb15 list-item-norightborder" data-id="' + data.id + '" data-index="' + i + '">' + data.name + '</a>';
                            });
                            $('#departmentLeft_department').html(itemLeft);

                            $('#departmentLeft_department a').on('click', function () {
                                $('.item-active').removeClass('item-active');
                                $(this).addClass('item-active');
                                var currentIndex = $(this).data('index');
                                option.getdepartment(currentIndex);
                            });
                        }
                    }
                });
            },
            // 获取子科室
            getdepartment: function (index){
                var item = '';
                $.each(departmentNodes[index], function (i, data) {
                    item += '<a class="list-item list-item-noborder text-left list-item-p-tb15" data-id="' + data.id + '" data-name="'+data.name+'">' + data.name + '</a>';
                });
                $('#departmentRight_department').html(item);

                $('#departmentRight_department a').on('click', function () {
                    $('#dropdownDepartment_department').removeClass('icon-down2').addClass('icon-right2');
                    $departmentItems_department.hide();
                    $('.sel-popup').hide();
                    $('#doctorItems').html('');

                    // 请求医生
                    department_id = $(this).data('id');
                    department_name = $(this).data('name');
                    $('#dropdownDepartment_department').html(department_name);
                    option.getDoctorList();

                });
            },

            // 获取城市区域
            getDepartment: function () {
                $.ajax({
                    type: 'GET',
                    url: textUrl+'/location/getProvinceList/',
                    data: {
                        page_size: '500',
                        page_index: 1,
                        sid: '',
                    },
                    dataType: 'jsonp',
                    jsonp: 'callback',
                    success: function (result) {
                        $('#departmentRight').html('');
                        if (result.ret == 0) {
                            var itemLeft = '';
                            childNodes = [];

                            $.each(result.data, function (i, o) {
                                var data = o;

                                childNodes.push(o.city_list);

                                itemLeft += '<a class="list-item text-left list-item-p-tb15 list-item-norightborder" data-id="' + data.id + '" data-index="' + i + '">' + data.name + '</a>';
                            });
                            $('#departmentLeft').html(itemLeft);

                            $('#departmentLeft a').on('click', function () {
                                $('.item-active').removeClass('item-active');
                                $(this).addClass('item-active');
                                province_ID = $(this).data('index');
                                var currentIndex = $(this).data('index');
                                option.getChildDepart(currentIndex);
                            });
                        }
                    }
                });
            },

            // 获取子城市
            getChildDepart: function (index) {
                var item = '';
                $.each(childNodes[index], function (i, data) {
                    item += '<a class="list-item list-item-noborder text-left list-item-p-tb15" data-id="' + data.code + '" data-name="'+data.name+'">' + data.name + '</a>';
                });
                $('#departmentRight').html(item);

                $('#departmentRight a').on('click', function () {
                    $('#dropdownDepartment').removeClass('icon-down2').addClass('icon-right2');
                    $departmentItems.hide();
                    $('.sel-popup').hide();
                    $('#doctorItems').html('');
                    pageIndex = 1;

                    // 请求医生列表
                    city_code = $(this).data('id');
                    city_name = $(this).data('name');
                    $('#dropdownDepartment').html(city_name);
                    option.getDoctorList();

                });
            },

            // 获取医生列表
            getDoctorList: function () {
                $.ajax({
                    type: 'GET',
                    url: textUrl+'/doctor/doctorIndex',
                    data: {
                        job_id: city_code,
                        hospital_id: hospital_ID,
                        department_id: department_id,
                        page_size: 20,
                        page_index: pageIndex
                    },
                    dataType: 'jsonp',
                    jsonp: 'callback',
                    success: function (result) {
                        if (result.ret == 0) {
                            if(result.data.length == 0){
                                $('#searchIcon').show();
                            }else{
                                $('#searchIcon').hide();
                            }

//                            alert("医院：" + hospital_ID + "科室：" +department_id+ "城市："+city_code);

                            var item = '';
                            $.each(result.data, function (i, o) {
                                var taginfo = '';
                                $.each(o.tag_info, function (j, t) {
                                    taginfo += t.tag_name + ' ';
                                });

                                var paramObj = new Object();
                                paramObj.doctorId = o.doctor_id;
                                paramObj.uid = o.uid;
                                paramObj.userName = o.user_name;
                                paramObj.headPic = o.avatar_file;
                                paramObj.hospitalName = o.hospital_name;
                                paramObj.jobName = o.job_name;
                                paramObj.departmentName = o.department_name;
                                paramObj.tagInfo = taginfo;

                                item+= '<div class="docterDetail" onclick="docterDetail('+o.doctor_id+')" style="position: relative;height: 60px;width: 100%;background-color: white;border-bottom: 1px solid #e6e6e6">';
                                item+= '<img src="' + o.avatar_file + '" alt="头像" class="top-user-img"/>';
                                item+= '<span class="message top-user-name">' + o.user_name +'</span>';
                                item+= '<span class="message top-user-name" style="left: 111px;top: 13px;font-size: 11px;color: #808080">' + o.job_name + '</span>';
                                item+= '<span class="message top-user-detail">' + o.hospital_name + ' &nbsp;' + o.department_name + '</span>';
                                item+= '<div class="top-user-recommended">';
                                item+= '<span class="recommend">'+ o.rec_index +'%</span>';
                                item+= '<span class="recommend1 message">推荐</span>';
                                item+= '</div>';
                                item+= '</div>';
                            });

                            // 前插新列表元素
//                            ptrContent.find('#doctorItems').html(item);
                            // 加载完毕需要重置
                            myApp.pullToRefreshDone();

                            // 加载数据
                            // 重置加载flag
                            loading = false;
                            if (lastIndex >= maxItems) {
                                // 加载完毕，则注销无限加载事件，以防不必要的加载
                                myApp.detachInfiniteScroll($('.infinite-scroll'));
                                // 删除加载提示符
                                $('.infinite-scroll-preloader').remove();
                                return;
                            }
                            // 如果正在加载，则退出
                            if (pageIndex >1 ){
                                // 添加新条目
                                $('#doctorItems').append(item);
                            }else{
                                $('#doctorItems').html(item);
                            }



                            // 更新最后加载的序号
                            lastIndex = $('#doctorItems').length;

                            if(result.data.length <= 20){
                                $('.infinite-scroll-preloader').hide();
                            }else{
                                $('.infinite-scroll-preloader').show();
                            }

                        }else{

                        }
                    }
                });
            }
        };

        $('#departmentLeft a').on('click', function () {
            $('#dropdownDepartment').removeClass('icon-down2').addClass('icon-right2');
            $departmentItems.hide();
            $('.sel-popup').hide();
            $('#doctorItems').html('');
            pageIndex = 1;

            // 请求医生列表
            city_code = $(this).data('id');
            city_name = $(this).data('name');
            $('#dropdownDepartment').html(city_name);
            option.getDoctorList();
        });

        // 医院
        $('#dropdownHospital').on('click', function () {
            //禁用滚动条
//            $('body').addClass('disabled-scroll');

            $('#dropdownDepartment').removeClass('icon-down2').addClass('icon-right2');
            $('#dropdownDepartment_department').removeClass('icon-down2').addClass('icon-right2');
            $departmentItems.hide();
            $departmentItems_department.hide();

            if (!$hospitalItems.is(':visible')) {
                $(this).removeClass('icon-right2').addClass('icon-down2');
                $hospitalItems.show();
                $('.sel-popup').show();
            }
            else {
                $(this).removeClass('icon-down2').addClass('icon-right2');
                $hospitalItems.hide();
                $('.sel-popup').hide();
            }

        });

        // 城市
        $('#dropdownDepartment').on('click', function () {
            $('#dropdownHospital').removeClass('icon-down2').addClass('icon-right2');
            $('#dropdownDepartment_department').removeClass('icon-down2').addClass('icon-right2');
            $hospitalItems.hide();
            $departmentItems_department.hide();

            if (!$departmentItems.is(':visible')) {
                $(this).removeClass('icon-right2').addClass('icon-down2');
                $departmentItems.show();
                $('.sel-popup').show();
            }
            else {
                $(this).removeClass('icon-down2').addClass('icon-right2');
                $departmentItems.hide();
                $('.sel-popup').hide();
            }
        });

        // 科室
        $('#dropdownDepartment_department').on('click', function () {
            // 获取科室
            option.getDepartmentList();

            $('#dropdownHospital').removeClass('icon-down2').addClass('icon-right2');
            $('#dropdownDepartment').removeClass('icon-down2').addClass('icon-right2');
            $hospitalItems.hide();
            $departmentItems.hide();
            if (!$departmentItems_department.is(':visible')) {
                $(this).removeClass('icon-right2').addClass('icon-down2');
                $departmentItems_department.show();
                $('.sel-popup').show();
            }
            else {
                $(this).removeClass('icon-down2').addClass('icon-right2');
                $departmentItems_department.hide();
                $('.sel-popup').hide();
            }
        });

        $('.over-popup').on('click', function () {
            $('#dropdownHospital,#dropdownDepartment,#dropdownDepartment_department').removeClass('icon-down2').addClass('icon-right2');
            $hospitalItems.hide();
            $departmentItems.hide();
            $departmentItems_department.hide();
            $('.sel-popup').hide();
        });

        // 获取医院列表
        option.getHospital();

        // 初始化医生列表
        option.getDoctorList();

        $('#back').on('click', function () {
            location.href = "../index.html";
        });

        // 刷新
        var myApp = new Framework7();
        var $$ = Dom7;
        // 下拉刷新页面
        var ptrContent = $$('.pull-to-refresh-content');
        // 添加'refresh'监听器
        ptrContent.on('refresh', function (e) {
//            city_code = '';     // 城市id
//            hospital_ID = '';   // 医院id
//            department_id = ''; // 科室id
//            $('#dropdownDepartment_department').html("科室");
//            $('#dropdownHospital').html("全部医院");
//            $('#dropdownDepartment').html("北京");
            pageIndex=1;
            option.getDoctorList();
        });

        // 加载数据
        var loading = false;
        // 上次加载的序号
        var lastIndex = $('#doctorItems').length;
        // 最多可加载的条目
        var maxItems = 20;
        // 注册'infinite'事件处理函数
        $$('.infinite-scroll').on('infinite', function () {
            // 如果正在加载，则退出
            if (loading) return;
            // 设置flag
            loading = true;
            pageIndex++;
            option.getDoctorList();
        });
    });

    function docterDetail(id){
        location.href = "chooseDoctor/docterDetail.html?docterId="+id;
    }


    //=========== 我的  ===========
    $(function () {

        var userimg;
        var username;
        var userPhone;


        var myPage = {
            //
            getMypage: function () {

                $.ajax({
                    type: 'GET',
                    url: textUrl+'/user/getNewUserinfo',
                    data: {
                        uid:$.cookie("local_userId")
                    },
                    dataType: 'jsonp',
                    jsonp: 'callback',
                    success: function (result) {
                        if (result.ret == 0) {

                            var data = result.data;
                            userimg = data.avatar_file;

                            username = data.user_name;
                            userPhone = data.mobile;
                            $('#userimg').attr('src',data.avatar_file);
                            $('#username').html(data.user_name);
                            $('#actievement').html('成就：'+data.reputation);
                            $('#income').html('收入：'+data.money);
                        }
                    }
                });
            }
        };

        $('#userimg').on('click', function () {
            $.cookie('index_username', username, { expires: 7,path: '/' });
            location.href = "myCenter/Individual_center.html?user_img="+userimg+"&user_phone="+userPhone+"";
        });

        $('#user_center').click(function () {
            $.cookie('index_username', username, { expires: 7,path: '/' });
            location.href = "myCenter/Individual_center.html?user_img="+userimg+"&user_phone="+userPhone+"";
        });

        $('#user_family').click(function () {
            location.href = "addPeople/contactPeople.html?type=1000";
        });

        $('#user_orders').click(function () {
//            location.href = "myCenter/mycenter_orderList.html";
            location.href= 'groupconsultation/order_stay.html';
        });

        $('#user_disMoney').click(function () {
            location.href = "myCenter/diagnosis_money.html";
        });

        $('#user_message').click(function () {
            location.href = "myCenter/mycenter_message.html";
        });

        $('#user_good').click(function () {
            location.href = "#";
        });

        $('#user_share').click(function () {
            location.href = "#";
        });

        $('.user-setup').click(function () {
            location.href = "myCenter/mycenter_setUp.html?phone="+userPhone;
        });

        myPage.getMypage();
    })


</script>
<script>
    //底部选项卡切换
    $(function(){
        $('.toolbar-inner a').children('img').eq(0).attr('src','img/icon_bot_0.png')
        $('.toolbar-inner a').click(function(){
            var index = $(this).index()
            var aL = $('.toolbar-inner a').length;
            for(var i= 0;i<aL;i++){
                $('.toolbar-inner a').children('img').eq(i).attr('src','img/icon_both_'+i+'.png')
            }
            $(this).children('img').attr('src','img/icon_bot_'+index+'.png');
            if(index==0){
                $('.searchbox').show();
            }else{
                $('.searchbox').hide();
            }
        })
    })
</script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript"></script>
<script src="js/weixin2.js"></script>
</body>
</html>